// 主页面JavaScript

document.addEventListener('DOMContentLoaded', function() {
    const startBtn = document.getElementById('start-btn');
    
    if (startBtn) {
        startBtn.addEventListener('click', function() {
            // 添加点击效果
            this.classList.add('pulse');
            
            // 延迟跳转以显示动画
            setTimeout(() => {
                // 跳转到设置页面
                window.location.href = '/settings';
            }, 300);
        });
    }
    
    // 添加页面加载动画
    document.querySelector('.welcome-section').classList.add('fade-in');
    
    // 创建随机装饰元素
    createDecorativeElements();
});

// 创建随机装饰元素
function createDecorativeElements() {
    const container = document.querySelector('.welcome-section');
    
    // 创建星星
    for (let i = 0; i < 5; i++) {
        const star = document.createElement('div');
        star.className = 'star';
        star.style.width = Math.random() * 20 + 10 + 'px';
        star.style.height = Math.random() * 20 + 10 + 'px';
        star.style.top = Math.random() * 100 + '%';
        star.style.left = Math.random() * 100 + '%';
        star.style.animation = `pulse ${Math.random() * 3 + 2}s infinite`;
        container.appendChild(star);
    }
    
    // 创建爱心
    for (let i = 0; i < 3; i++) {
        const heart = document.createElement('div');
        heart.className = 'heart';
        heart.style.width = Math.random() * 20 + 10 + 'px';
        heart.style.height = Math.random() * 20 + 10 + 'px';
        heart.style.top = Math.random() * 100 + '%';
        heart.style.left = Math.random() * 100 + '%';
        heart.style.animation = `bounce ${Math.random() * 3 + 2}s infinite`;
        container.appendChild(heart);
    }
}